package com.example;

import java.util.Properties;

import javax.sql.DataSource;

public class UseUserDataSourceFactory {
    public static void main(String[] args) {
        // 获取项目配置
        Properties properties = ConfigProperties.getProperties();
        // 构造数据源
        UserDataSourceFactory userDataSourceFactory = new UserDataSourceFactory();
        userDataSourceFactory.setProperties(properties);
        DataSource dataSource = userDataSourceFactory.getDataSource();
        System.out.println(dataSource);
        // => org.apache.ibatis.datasource.pooled.PooledDataSource@4e9ba398
    }
}
